# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Election do
  @moduledoc """
  Information about the election that was queried.

  ## Attributes

  *   `electionDay` (*type:* `String.t`, *default:* `nil`) - Day of the election in YYYY-MM-DD format.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The unique ID of this election.
  *   `name` (*type:* `String.t`, *default:* `nil`) - A displayable name for the election.
  *   `ocdDivisionId` (*type:* `String.t`, *default:* `nil`) - The political division of the election. Represented as an OCD Division ID. Voters within these political jurisdictions are covered by this election. This is typically a state such as ocd-division/country:us/state:ca or for the midterms or general election the entire US (i.e. ocd-division/country:us).
  *   `shapeLookupBehavior` (*type:* `String.t`, *default:* `nil`) - 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :electionDay => String.t() | nil,
          :id => String.t() | nil,
          :name => String.t() | nil,
          :ocdDivisionId => String.t() | nil,
          :shapeLookupBehavior => String.t() | nil
        }

  field(:electionDay)
  field(:id)
  field(:name)
  field(:ocdDivisionId)
  field(:shapeLookupBehavior)
end

defimpl Poison.Decoder, for: GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Election do
  def decode(value, options) do
    GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Election.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CivicInfo.V2.Model.CivicinfoSchemaV2Election do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
